﻿using System.Collections.Generic;
using System.Linq;
using Citi.PTSConsolidation.Domain;

namespace Citi.PTSConsolidation.WebUi.Models
{
    public class ProjectModel
    {
        public string Id { get; set; }
        public string ProjectName { get; set; }
        public ProgramModel Program { get; set; }

        public static ProjectModel CreateModel(Project domain)
        {
            return new ProjectModel
            {
                 Id = domain.Id,
                 ProjectName = domain.ProjectName,
                 Program = ProgramModel.CreateModel(domain.Program)
            };
        }

        public static IEnumerable<ProjectModel> CreateModel(IEnumerable<Project> domain)
        {
            return domain.Select(CreateModel);
        }
    }
}